<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>销售单</title>
    <style type="text/css">
        .header-container{
            width:991px;
            margin: 0 auto;
            height:25px;
            line-height: 25px;
            position: relative;
        }
        .table{
            box-sizing: border-box;
            width:991px;
            margin: 10px auto 0 auto;
        }
        .table tr td{
            text-align: center;
            border: #000000 1px solid;
            height:25px;
            line-height: 25px;
        }
        .layui-fluid {
            color: #000;
            font-size:16px;
        }
        .marginTop {
            margin-top: 15px;
        }
        .table td {
            height: 25px;
        }
    </style>
    <% include("../layout/css.html"){} %>
</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-row header-container hide-print" style="margin-bottom: 40px;">
        <div class="layui-col-md12">
            <div>
                <button type="button" class="layui-btn icon-btn" lay-filter="searchSubmit"  id="printBtn">
                    <i class="layui-icon">&#xe615;</i>打印
                </button>
            </div>
        </div>
    </div>
    <div class="layui-row header-container">
        <div style="font-size:26px;font-weight: bold;width:530px;display:flex;flex-flow: row nowrap;justify-content:center;margin:0 auto;">
            <div style="">${company.name}</div>
            <div style="margin-left:20px;">销售单</div>
        </div>
    </div>
    <div class="layui-row header-container marginTop">
        <div style="width:300px; position:absolute;left:0px;top:0px;">销售单号:${sell.code}</div>
        <div style="width:250px; position:absolute;right:50px;top:0px;">销售单日期:${sell.sellTime}</div>
    </div>
    <div class="layui-row header-container">
        <div style="width:300px; position:absolute;left:0px;top:0px;">客户:${sell.supplier}</div>
    </div>
    <table class="table" cellspacing="0" cellpadding="0" >
        <thead>
        <tr>
            <td >产品名称</td>
            <td >规格</td>
            <td >长度</td>
            <td >数量</td>
            <td >重量</td>
            <td >单价</td>
            <td >金额</td>
        </tr>
        </thead>
        <tbody>
        <%for(item in sellSonList){%>
        <tr>
            <td>${item.productName}</td>
            <td>${item.specification}</td>
            <td>${item.lengths}</td>
            <td>${@com.wf.ew.common.utils.beetl.NumToFix.fixDouble(item.num)}</td>
            <td>${item.actualWeight}</td>
            <td>${@com.wf.ew.common.utils.beetl.NumToFix.fixString(item.price)}</td>
            <td>${item.totalPrice}</td>
        </tr>
        <%}%>
        <%for(var i = sellSonList.~size; i < 7; i ++){%>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <%}%>
        <tr>
            <td style="height: 18px;line-height: 18px;">总计</td>
            <td colspan="5" style="padding: 10px;text-align: left;height: 18px;line-height: 18px;">
                金额合计大写:<span id="priceUpper"></span>
            </td>
            <td style="padding: 10px;height: 18px;line-height: 18px;">￥${sell.total}</td>
        </tr>
        </tbody>
    </table>
    <table class="table" cellspacing="0" cellpadding="0" style="margin:0px auto;">
        <tbody>
        <tr>
            <td style="border-top:0px;width:535px;text-align:left;padding-left:5px;font-size: 12px;line-height: 20px;">
                1、货物数量请由需方或需方代表当面点清,出库一律不负责.<br/>
                2、使用前对货物进行检验确定,符合要求后方可使用.<br/>
                3、如上述产品确有质量问题,需方应在一周内书面向供方提出质量异议,否则视为合格.<br/>
                4、发票请于当月开清,此单盖章有效.<br/>
                5、如发生纠纷,由供方所在地法院处理.</td>
            <td style="border-top:0px;vertical-align:text-top;text-align:left;padding-left:5px;">记账方式:</br>${sell.state}</td>
            <td style="border-top:0px;vertical-align:text-top;text-align:left;padding-left:5px;">制单人:</br>${user.nickName}</td>
            <td style="border-top:0px;vertical-align:text-top;text-align:left;padding-left:5px;width:170px;">收货单位经办人:(请审核无误后签字)</br></td>
        </tr>
        </tbody>
    </table>
    <div class="layui-row header-container" style="margin-top:8px;">
        <div style="width:500px; position:absolute;left:0px;top:0px;">地址:${company.address}</div>
        <div style="width:160px; position:absolute;left:540px;top:0px;">电话:${company.tel}</div>
        <div style="width:160px; position:absolute;left:772px;top:0px;">传真:${company.fax}</div>
    </div>
    <div class="layui-row header-container" style="margin-top:0px;">
        <div style="width:500px; position:absolute;left:0px;top:0px;">手机:${company.phone}&nbsp;&nbsp;${company.phone2}</div>
    </div>

</div>

<!-- js部分 -->
<% include("../layout/js.html"){} %>
<script type="text/javascript">
    layui.use(['layer', 'form', 'formX', 'index','table',
        'util', 'admin', 'zTree', 'tableX','laydate','printer'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var util = layui.util;
        var admin = layui.admin;
        var tableX = layui.tableX;
        var formX = layui.formX;
        var index = layui.index;
        var laydate = layui.laydate;
        var printer = layui.printer;

        $("#printBtn").click(function(){
            printer.print({
                hide: ['.no-print'],  // 打印时隐藏的元素
                /*horizontal: false,*/  // 是否横向打印
                blank: false,  // 是否打开新页面打印
                close: false,  // 如果是打开新页面，打印完是否关闭
                iePreview: false  // 是否兼容ie打印预览
            });
        });
        $("#priceUpper").html(Arabia_to_Chinese(${sell.total}));
    });
</script>
</body>
</html>
